package alejandro.castro.asteroid.moving;



import alejandro.castro.abstracts.MovableComponent;

import com.uqbar.vainilla.DeltaState;

public class MovingToLeft extends MovingHorizontal {
	
	public static MovingHorizontal instancia;
	
	public static MovingHorizontal getInstance(){
		if(instancia == null){
			instancia = new MovingToLeft();
		}
		return instancia;
	}

	@Override
	public void updateH(MovableComponent componente, DeltaState deltaState) {
		if(!releaseHAt(KEY_LEFT, deltaState, componente)){
			super.checkRight(componente, deltaState);
			componente.turnLeft(deltaState);
		}
		else{
			if(deltaState.isKeyBeingHold(KEY_RIGHT)){
				componente.setRightEstado();
			}
		}		
	}






}
